<?php



// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'FoundCMS',
    'sourceLanguage'=>'en_us',
	'language'=>'zh_cn',
    'theme'=>'default', //set default theme
    'timeZone'=>'Asia/Shanghai', //set timeZone

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
        'application.extensions.*',
        //'application.modules.backend.components.*'
	),

	'modules'=>array(
		'backend'=>array(
		     'class'=>'application.modules.backend.BackendModule',
		),
		'account'=>array(
		     'class'=>'application.modules.account.AccountModule',
		),
		// uncomment the following to enable the Gii tool
		/*'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'123456',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),*/
		
	),

	// application components
	'components'=>array(

	    'request'=>array(
	        // overwrite HttpRequest class
	        //'class'=>'application.components.HttpRequest',
	        // Enable Yii Validate CSRF Token
	        'enableCsrfValidation'=>true,
            // Enable Cookie Validate
            'enableCookieValidation'=>true,
        ),
		'session'=>array(
		    'timeout'=>86400,
        ),

		// cache method
		'cache'=>array(
		    // cache method is file cache
           'class'=>'system.caching.CFileCache',
        ),

		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
            'class' => 'CWebUser',
            'stateKeyPrefix'=>'member', //这个是设置前台session的前缀
            // 默认跳转到前台登录页
            'loginUrl'=>array('site/login'),
		),

        //RBAC config
        'authManager' => array(
            'class' => 'CDbAuthManager', // 认证类名称
            'itemTable' => 'fcms_auth_item', //认证项表名称
            'itemChildTable' => 'fcms_auth_item_child', //认证项父子关系
            'assignmentTable' => 'fcms_auth_assignment', //认证项赋权关系
            'defaultRoles' => array('Guest'), //默认角色
        ),

		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			//'urlFormat'=>'path', //open or close urlManager
            'showScriptName'=>false, //隐藏index.php
			//'urlSuffix'=>'.html', //伪静态后缀
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),

		// database settings are configured in database.php
		'db'=>require(dirname(__FILE__).'/database.php'),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>YII_DEBUG ? null : 'site/error',
		),

		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				//array('class'=>'CWebLogRoute',),

			),
		),

	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in backend main page
		'adminEmail'=>'webmaster@found5.com',
        'version' => '2.0.8',

	),
);
